#include "mainwidget.h"
#include "configview.h"
#include "plotshowwidget.h"

MainWidget::MainWidget(QWidget *parent) :
    QWidget(parent)
{
    this->setupUI();
}

void MainWidget::setupUI()
{
    QHBoxLayout *mainLayout = new QHBoxLayout(this);

	QVBoxLayout *vLayout = new QVBoxLayout();
    // add config view
    ConfigView *configView = new ConfigView(new ConfigData());
    vLayout->addWidget(configView);
	// add control buttons
	QHBoxLayout *hLayout = new QHBoxLayout();
	QPushButton *startButton = new QPushButton("Start");
	QPushButton *stopButton = new QPushButton("Stop");
	QPushButton *reservedButton = new QPushButton("Reserved");
	hLayout->addWidget(startButton);
	hLayout->addWidget(stopButton);
	hLayout->addWidget(reservedButton);
	vLayout->addLayout(hLayout);
	mainLayout->addLayout(vLayout);

    QSpacerItem *spacer = new QSpacerItem(10, 20, QSizePolicy::Fixed, QSizePolicy::Minimum);
    mainLayout->addSpacerItem(spacer);

    // add plot show widget
    PlotShowWidget *plotShow = new PlotShowWidget();
    mainLayout->addWidget(plotShow);
    mainLayout->addStretch();
}
